<div class="statistic table-scrollable" ng-app="statistic" ng-controller="statisticCtrl">
    <div class="query_param_area" style="margin: auto 20px">
        <h4>查询条件</h4>

        <form class="form form-inline">
            <div class="form-group" style="padding-right: 5px">
                <label>月份</label>
                <div  style="display: inline-block" class="input-append date form_datetime">
                    <input id="queryPeriod" type="text" readonly class="form-control" ng-model="queryParams.queryPeriod"/>
                    <span class="add-on" ng-click="queryParams.queryPeriod=''"><i class="icon-remove glyphicon glyphicon-remove"></i></span>
                </div>
            </div>
            <div class="form-group">
                <label>排序</label>
                <select type="text" class="form-control" ng-model="queryParams.orderBy" ng-change="orderByChange()">
                    <option value="user_rate">上报人数比例</option>
                    <option value="machine_rate">上报设备比例</option>
                </select>
            </div>
            <div class="form-group" style="float: right">
                <button class="btn btn-default" ng-click="queryStatistic()">查询</button>
            </div>
        </form>
    </div>
    <hr/>
    <div class="query_chart_area">
        <div id="statisticChart" style="width: 100%;height: 400px;"></div>
    </div>
    <div class="query_result">
        <table class="table table-striped table-hover">
            <tr>
                <th>部门</th>
                <th>总人数</th>
                <th>上报人数</th>
                <th>上报人数比例</th>
                <th>设备总数</th>
                <th>上报设备</th>
                <th>上报设备比例</th>
                <th>未处理文件总数</th>
                <th>未处理文件总大小</th>
                <th>涉密文件总数</th>
                <th>涉密文件总大小</th>
            </tr>
            <tbody>
            <tr ng-repeat="record in statisticRecords|orderBy:['-'+queryParams.orderBy,'-person_count']">
                <td><a ui-sref="home.content.detectLog.machineStatisticList({deptName:record.dept_name,queryPeriod:queryParams.queryPeriod})">{{record.dept_name}}</a>
                </td>
                <td>{{record.person_count}}</td>
                <td>{{record.user_report_count}}</td>
                <td>{{record.user_rate}}%</td>
                <td>{{record.machine_count}}</td>
                <td>{{record.machine_report_count}}</td>
                <td>{{record.machine_rate}}%</td>
                <td>{{record.report_file_count}}</td>
                <td>{{record.report_file_size_str}}</td>
                <td>{{record.scan_file_count}}</td>
                <td>{{record.scan_file_size_str}}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>